﻿using System.Net;

namespace MingleReport.HttpRequests
{
    public class MingleHttpStoryCardRequest : AbstractMingleHttpRequest
    {
        private const string CARDS_XML = "cards.xml";

        private readonly string projectId;
        private readonly CookieContainer loginCookie;

        public MingleHttpStoryCardRequest(string server, string projectId,
                                          CookieContainer loginCookie) : base(server)
        {
            this.projectId = projectId;
            this.loginCookie = loginCookie;
        }

        public override string PostString
        {
            get { return null; }
        }

        public override void Create()
        {
            httpRequest = (HttpWebRequest) WebRequest.
                                               Create(
                                               string.Format("{0}/projects/{1}/{2}", server, projectId, CARDS_XML));
            httpRequest.CookieContainer = loginCookie;
        }
    }
}